package com.github.phoenics.militia.common.eventBus;

import com.google.common.eventbus.EventBus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 事件总线配置
 *
 * @author Phoenics Chow
 * on 2019年01月14日
 */
@Configuration
@ComponentScan(".")
public class MyEventBus {
    private static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(MyEventBus.class);
    private static EventBus _eventBus=null;
    @Bean
    public EventBus eventBus() {
        return new EventBus();
    }
    @Autowired
    public void setEventBus(EventBus eventBus){
        _eventBus=eventBus;
    }
    public static EventBus takeEventBus(){
        return _eventBus;
    }
}
